#include<cstdio>
#include<algorithm>

#define N 105
#define M 105
using namespace std;

int n,m;
char t[N][N];
char p[M][M];

int main(int argc, char** argv){
    int i,j,k;
    // File input
    FILE *in1 = freopen(argv[1], "r", stdin);
    FILE *in2 = fopen(argv[2], "r");

    // Input
    fscanf(in1, "%d %d",&m, &n);
    for(i = 0; i < m;i++) {
        fscanf(in1,"%s",&p[i]);
    }
    for(i = 0; i < n;i++) {
        fscanf(in1, "%s",&t[i]);
    }

    // Naive search
    int ii,jj,er, err;
    err = 0;
    for(i = 0; i < n-m+1 && err == 0;i++){
        for(j = 0; j < n-m+1 && err == 0;j++){
            er = 0;
            for(ii = 0; ii < m && er == 0;ii++){
                for(jj = 0; jj < m && er == 0;jj++){
                    if (t[i+ii][j+jj] != p[ii][jj])
                        er = 1;
                }
            }
            if (er == 0){
                // There is a match.
                if (fscanf(in2, "%d %d", &ii, &jj)!=-1) {
                    if (!(ii == i+m-1 && jj == j+m-1))
                        err = 1;
                }else{
                    err = 1;
                }
            }
        }
    }

    // If there is more, then incorrect.
    if (fscanf(in2, "%d %d", &ii, &jj)!=-1)
        err = 1;
    if (!err)
        printf("correct\n");
    else
        printf("incorrect\n");
    return 0;
}
